<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>获取token测试</title>
</head>
<body>
    <button class="submit">获取token</button>
    <p class="my-token"></p>
    <script src="./js/axios.js"></script>
    <script>
        let token = '';
        axios({
            url: '/admin/system/sysRole/token'
        }).then(result => {
            token = result.data.data.token;
            console.log(token)
        })

        document.querySelector('.submit').addEventListener('click',() => {
            axios({
                url: '/admin/system/sysRole/see',
                headers:{
                    token
                }
            }).then(result => {
                console.log(result);
            })
        })
    </script>
</body>
</html>